{template 'common/header'}
{template 'nav'}
{if $op == 'list'}
<div class="main panel panel-danger">
<div class="panel-heading ">
	嘉宾列表
</div>
	<div class="panel-body table-responsive">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:5em">排序</th>
					<th style="width:5em">嘉宾姓名</th>
					<th style="width:5em">嘉宾头像</th>
					<th style="width:25em">嘉宾简介</th>
					<th style="width:10em">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $jb}
				<tr>
				    <td><span class="label label-danger">{$jb['displayid']}</span></td>
					<td><span class="label label-info">{$jb['name']}</span></td>
					<td><img src="{php echo tomedia($jb['tx'])}" width=40px height=40px /></td>
					<td>{php echo html_entity_decode($jb['des'])}</td>
					<td style="text-align:left;">
						<a href="{php echo $this->createWebUrl('jb_manage', array('id' => $id,'op' => 'post', 'jb_id' => $jb['id']))}" class="btn btn-success btn-sm" data-toggle="tooltip" data-placement="top" title="修改"><i class="fa fa-edit"></i></a>
						<a href="{php echo $this->createWebUrl('jb_manage', array('id' => $id,'op' => 'del', 'jb_id' => $jb['id']))}"class="btn btn-danger btn-sm" data-toggle="tooltip" data-placement="top" title="删除" onclick="return confirm('删除将无法恢复，确认吗？');return false;"><i class="fa fa-times"></i></a>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
		{$pager}
	</div>
</div>
<script>
	require(['bootstrap'],function($){
		$('.btn').hover(function(){
			$(this).tooltip('show');
		},function(){
			$(this).tooltip('hide');
		});
	});
</script>
{elseif $op == 'post'}

<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" onsubmit='return formcheck()'>
		<input type="hidden" name="jb_id" value="{$jb['id']}" />
		<div class="panel panel-danger">
			<div class="panel-heading">
				添加嘉宾
			</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span><span class="label label-success">嘉宾排序</span></label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" id='displayid' name="displayid" class="form-control" value="{$jb['displayid']}" placeholder="嘉宾排序"/>
						<span class="help-block">嘉宾列表里的排列位置</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span><span class="label label-success">嘉宾姓名</span></label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" id='name' name="name" class="form-control" value="{$jb['name']}" placeholder="请填写嘉宾姓名" />
						<span class="help-block">嘉宾姓名</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">嘉宾头像</label>
					<div class="col-sm-9">
						{php echo tpl_form_field_image('tx', $jb['tx']);}
						<span class="help-block">嘉宾头像 规格200*200</span>
					</div>
				</div>
				<div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">嘉宾简介</label>
                    <div class="col-xs-12 col-sm-9">
                        {php echo tpl_ueditor('des',$jb['des'])}
									<span class="help-block">嘉宾简介</span>
                    </div>
                </div>
			</div>
		</div>
<div class="form-group col-sm-12">
	<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
	<input type="hidden" name="token" value="{$_W['token']}" />
	</div>
	</form>
</div>
{/if}
{template 'common/footer'}